package com.itheima.mystream;

import java.util.ArrayList;
import java.util.List;

/**
 * Stream流的终结方法
 */
public class Demo5 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>(List.of("张三丰","张无忌","张翠山","王二麻子","张良","谢广坤"));
        //遍历中介方法
        list.stream().forEach(s -> System.out.println(s));
        //计数器终结
        System.out.println(list.stream().count());
    }
}
